<!DOCTYPE html>
<html lang="en">
<head>
<base href="${contextPath}/" />
<meta charset="utf-8">
<title>国际学院学生数据管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
	content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
<meta name="author" content="Muhammad Usman">
<!-- The styles -->
<link id="bs-css" href="css/bootstrap-cerulean.min.css" rel="stylesheet">
<link href="css/charisma-app.css" rel="stylesheet">
<link href='bower_components/fullcalendar/dist/fullcalendar.css' rel='stylesheet'>
<link href='bower_components/fullcalendar/dist/fullcalendar.print.css' rel='stylesheet' media='print'>
<link href='bower_components/chosen/chosen.min.css' rel='stylesheet'>
<link href='bower_components/colorbox/example3/colorbox.css' rel='stylesheet'>
<link href='bower_components/responsive-tables/responsive-tables.css' rel='stylesheet'>
<link href='bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css' rel='stylesheet'>
<link href='css/jquery.noty.css' rel='stylesheet'>
<link href='css/noty_theme_default.css' rel='stylesheet'>
<link href='css/elfinder.min.css' rel='stylesheet'>
<link href='css/elfinder.theme.css' rel='stylesheet'>
<link href='css/jquery.iphone.toggle.css' rel='stylesheet'>
<link href='css/jquery.dataTables.min.css' rel='stylesheet'>
<link href='css/uploadify.css' rel='stylesheet'>
<link href='css/animate.min.css' rel='stylesheet'>
<!-- jQuery -->
<script src="bower_components/jquery/jquery.min.js"></script>

<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
<!-- The fav icon -->
<link rel="shortcut icon" href="img/favicon.ico">

<style type="text/css">
	table.dataTable thead td {
		padding: 10px 18px;
		border-bottom: 1px solid #111111;
	}
	
	table.dataTable tfoot th, table.dataTable tfoot td {
		padding: 10px 18px 6px 18px;
		border-top: 1px solid #111111;
	}
	
	table.dataTable.no-footer {
		border-bottom: 1px solid #111111;
	}
	
	.dataTables_wrapper.no-footer .dataTables_scrollBody {
		border-bottom: 1px solid #111111;
	}
</style>
</head>

<body>
	<!-- topbar starts -->
	<#include "commonPage/top.ftl">
	<!-- topbar ends -->
	<div class="ch-container">
		<div class="row">

			<!-- left menu starts -->
			<#include "commonPage/left.ftl">
			<!--/span-->
			<!-- left menu ends -->

			<noscript>
				<div class="alert alert-block col-md-12">
					<h4 class="alert-heading">Warning!</h4>

					<p>
						You need to have <a href="http://en.wikipedia.org/wiki/JavaScript"
							target="_blank">JavaScript</a> enabled to use this site.
					</p>
				</div>
			</noscript>

			<div id="content" class="col-lg-10 col-sm-10">
				<!-- content starts -->
				<div></div>

				<!--/学生基本信息显示-->
				<div class="row">
					<div class="box col-md-12">
						<div class="box-inner">
							<div class="box-header well" data-original-title="">
								<h2 >
									<i class="glyphicon glyphicon-user"></i> 学生信息
								</h2>
							</div>
							<div class="box-content">
							<!-- 添加查询条件 -->
							
									<div class="control-group" style="margin-left: 10px;float:left;">
									
									<select name="major_id" id="majorSelect" data-rel="chosen"
										onchange="showMsg()" style="width: 90px;"
										data-placeholder="专业"> <#list marjorList as mlist>
										<option selected="selected" value=""></option>
										<option value="${mlist.m_id!}" class="major"> ${mlist.simpleName!}</option>
										</#list>
									</select> 
									
									<select name="classes_id" id="classesSelect" style="width: 90px;"  data-placeholder="班级">
										<option selected="selected" value=""></option>
									</select>
									<div id="resText"></div>
									<div class="mc_embed_signup">
										<div style="margin-top: 10px">
											<div class="clear" >
												<input onclick="findInfo()" style="width: 20px" type="submit" value="查找" name="subscribe" class="button">
											</div>
										</div>
									</div>
								</div>
								<a   class="btn btn-success"  style="float:right;" title="添加学生"  href="stu/toAddStudent"> <i	class="glyphicon glyphicon-plus icon-white">添加学生</i></a>
						<div style="clear:both"></div>
					</div>
					
					<!-- 添加查询条件 -->
							 
								 <table id="example" style="border:1px #dddddd solid;"  class="table table-striped table-bordered  bootstrap-datatable responsive"> 
									<thead>
										<tr>
											<th>学号</th>
											<th>姓名</th>
											<th>性别</th>
											<th>专业</th>
											<th>班级</th>
											<th>籍贯</th>
											<th>政治面貌</th>
											<th style="width:140px;">操作</th>
										</tr>
									</thead>
									<tbody>
										<#list stuList as list>
										<tr>
											<td>${list.sno!}</td>
											<td class="center"><a href="stu/getStuInfo?stuId=${list.s_id!}">${list.stuname!}</a></td>
											<td class="center">${list.stusex!}</td>
											<td class="center">${list.mname!}</td>
											<td class="center">${list.cname!}</td>
											<td class="center">${list.position!}</td>
											<td class="center">${list.face!}</td>
											<td class="center" style="width:140px;">
												<a class="btn btn-success"  href="info/toAddInfo?id=${list.s_id!}" title="添加项目信息"> <i
														class=" glyphicon glyphicon-plus-sign"></i> 
												</a> 
												<a class="btn btn-info" href="stu/toEdit?id=${list.s_id!}" title="修改"> <i
														class="glyphicon glyphicon-edit icon-white"></i> 
												</a> 
												<a class="btn btn-danger" href="javascript:deleteStudent(${list.s_id!});" title="删除"> <i class="glyphicon glyphicon-trash icon-white"></i> 
												</a>
											</td>
										</tr>
										</#list>
									</tbody>
								</table>
							</div>
						</div>
					</div>
					<!--/span-->

				</div>
				<!--/row-->



				<!-- content ends -->
			</div>
			<!--/#content.col-md-0-->
		</div>
		<!--/fluid-row-->

		<!-- Ad, you can remove it -->

		<!-- Ad ends -->

		<hr>





	</div>
	<!--/.fluid-container-->

	<!-- external javascript -->

	<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
	<script src="js/jquery.cookie.js"></script>
	<script src='bower_components/moment/min/moment.min.js'></script>
	<script src='bower_components/fullcalendar/dist/fullcalendar.min.js'></script>
	<script src='js/jquery.dataTables.min.js'></script>
	<script src="bower_components/chosen/chosen.jquery.min.js"></script>
	<script src="bower_components/colorbox/jquery.colorbox-min.js"></script>
	<script src="js/jquery.noty.js"></script>
	<script src="bower_components/responsive-tables/responsive-tables.js"></script>
	<script	src="bower_components/bootstrap-tour/build/js/bootstrap-tour.min.js"></script>
	<script src="js/jquery.raty.min.js"></script>
	<script src="js/jquery.iphone.toggle.js"></script>
	<script src="js/jquery.autogrow-textarea.js"></script>
	<script src="js/jquery.uploadify-3.1.min.js"></script>
	<script src="js/jquery.history.js"></script>
	<script src="js/charisma.js"></script>  
	<script type="text/javascript">
	function deleteStudent(id){
		if(confirm("确定要删除学生么?")){
			window.location.href = "stu/delete?id=" +id;
		}
	}
	</script>
<script type="text/javascript">
	
	/**
	* 删除信息
	*/
	function deleteInfo(id){
		if(confirm("确定要删除信息么?")){
			window.location.href = "info/delete?id=" +id;
		}
	}
	/**
	*专业班级下拉框
	*/
		function showMsg(obj) {
		 	$.ajax({
				type : "post",
				url : "info/getClassesWithM_id",
				data : {
					m_id : $("#majorSelect").val()
				},
				dataType : "json",
				success : function(data) {
					$("#classesSelect").empty();
					$("#classesSelect").append("<option selected='selected' value=''></option>");
					for(var i = 0; i < data.length; i++){
						$("#classesSelect").append("<option  value='"+data[i].cid+"'>"+data[i].cname+"</option>");
						}
				}
			}); 
		}
		
		$(document).ready(function() {
			 $("#example").dataTable({
				 "language": {
					 "url" : "commonPage/language.txt",
				    },
			 });
		 } ); 
		/*
		*搜索学生信息
		*/
		function findInfo(){
			
			var mid=$("#majorSelect").val();
			var cid=$("#classesSelect").val();
			if(mid=='')
			{
				
				window.location.href="stu";
			}else
				{
				
					window.location.href="stu/searchStu?m_id="+mid+"&c_id="+cid;
				 
				}
				
			 } 	
		 /* 	 $('#example tbody').on( 'click', 'button', function () {
			        var data = table.row( $(this).parents('tr') ).data();
			         alert( data[0] +"'s salary is: "+ data[ 4 ] ); 
			    } ); 
		 
		
		 
		 $.ajax({
						type:"post",
						url:"/stu/searchStu",
						data:{
							m_id : $("#majorSelect").val(),
							c_id : $("#classesSelect").val()
						},
						success:function(data){	
						}
					});
		 
		 
		 */
		/* $("#button").click(function(){ */
			/* function findInfo(){
			$.ajax({
				type : "GET",
				url : "info/getInfo",
				data : {
					m_id : $("#majorSelect").val(),
					c_id : $("#classesSelect").val(),
					p_id : $("#projectSelect").val()
				},
				dataType : "json",
				success : function(data) {
					$("#tbody").empty();
					for(var i = 0; i < data.length; i++){
						var table = "<tr><td class='center'>"+data[i].stuname+"</td><td class='center'>"+data[i].simpleName+data[i].cname+"</td><td class='center'>"+data[i].grade+"</td><td class='center'>"+data[i].date+"</td><td class='center'>"+data[i].description+"</td>";
						var caozuo = "<td class='center' width='110px'><a class='btn btn-info' title='修改' href='info/toUpdate?id="+data[i].info_id+"'> <i class='glyphicon glyphicon-edit icon-white'></i></a> <a class='btn btn-danger' title='删除' href='javascript:deleteInfo("+data[i].info_id+");'><i	class='glyphicon glyphicon-trash icon-white'></i></a></td></tr>";
						table = table + caozuo;
						$("#tbody").append(table);
						}
				}
			}); 
		} */
		
			/* function deleteInfo(var infoId){
				$.ajax({
					type : "GET",
					url : "info/deleteInfo",
					data : {
						id : infoId
					},
					dataType : "json",
					success : function(data) {
						alert(data[0].m);
					}
				}); 
			} */
	</script>
</body>
</html>
